package com.oracle.application.controller;

import com.oracle.application.feign.OrdersFeign;
import com.oracle.application.feign.vo.CartVo;
import com.oracle.application.feign.vo.OrderConfirmVo;
import com.oracle.application.feign.vo.OrderSbumitVo;
import com.oracle.application.feign.vo.Orderinfo;
import com.oracle.application.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/orders")
@RestController
public class OrdersConsumerController {

    @Autowired
    private OrdersFeign ordersFeign;

    @GetMapping("/confirm")
    public R<OrderConfirmVo> confirm(List<CartVo> cartVos){
        R<OrderConfirmVo> confirm = ordersFeign.confirm(cartVos);
        return confirm;
    }
    @PostMapping("/submit")
    public R submit(@RequestBody OrderSbumitVo orderSbumitVo){
        R submit = ordersFeign.submit(orderSbumitVo);
        return submit;
    }
}

